__author__ = 'wangzk'
"""输入年月日，来判断是当年中的第几天
"""
data = str(input("输入查询的年月日,格式为xxxx-xx-xx:\n"))
time_list = data.split("-")
year = int(time_list[0])
month = int(time_list[1])
day = int(time_list[2])
def run_ping(year):
    if (year % 4 ==0 and year%100!=0) or(year %400 == 0):
        year_num = 366
    else:
        year_num = 365
    return year_num
def yuefen(month):
    if month == 1:
        yuefen_num = 0
    elif month == 2:
        yuefen_num =31
    elif month == 3:
        yuefen_num =59
    elif month ==4:
        yuefen_num =90
    elif month ==5:
        yuefen_num =120
    elif month ==6:
        yuefen_num =151
    elif month ==7:
        yuefen_num =181
    elif month ==8:
        yuefen_num =212
    elif month ==9:
        yuefen_num =243
    elif month ==10:
        yuefen_num =273
    elif month ==11:
        yuefen_num =304
    elif month ==12:
        yuefen_num =334
    return yuefen_num
y_m = 0
number = run_ping(year)
if number == 366:
    y_m = yuefen(month)+1
elif number == 365:
    y_m = yuefen(month)
day_where = y_m +day
print(day_where)
